package com.tjhk.demo.consumer;

import com.tjhk.demo.contants.RabbitMqQueueConstants;
import org.springframework.amqp.core.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMqBindingConfig {
    /**DIRECT QUEUE*/
    public final static String DIRECT_EXCHANGE_NAME = "direct_queue_demo";

    /**TOPIC QUEUE*/
    public final static String TOPIC_EXCHANGE_NAME = "topic_queue_demo";

    /**FANOUT QUEUE*/
    public final static String FANOUT_EXCHANGE_NAME = "fanout_queue_demo";

    //DIRECT_INFORM_QUEUE队列绑定交换机，指定routingKey
//    @Bean
//    public Binding BINDING_EMAIL(@Qualifier(RabbitMqQueueConstants.TOPIC_EXCHANGE_NAME) Queue queue,
//                                 @Qualifier(RabbitMqConstants.QUEUE_EXCHANGE_NAME) Exchange exchange){
//        return BindingBuilder.bind(queue).to(exchange).with(RabbitMqConstants.EMAIL_ROUTING_KEY).noargs();
//    }
//
//    //SMS_INFORM_QUEUE队列绑定交换机，指定routingKey
//    @Bean
//    public Binding BINDING_SMS(@Qualifier(RabbitMqConstants.SMS_INFORM_QUEUE) Queue queue,
//                               @Qualifier(RabbitMqConstants.QUEUE_EXCHANGE_NAME) Exchange exchange){
//        return BindingBuilder.bind(queue).to(exchange).with(RabbitMqConstants.SMS_ROUTING_KEY).noargs();
//    }
//
//    //FDL_INFORM_QUEUE队列绑定交换机，指定routingKey
//    @Bean
//    public Binding BINDING_FDL(@Qualifier(RabbitMqConstants.FDL_INFORM_QUEUE) Queue queue,
//                               @Qualifier(RabbitMqConstants.QUEUE_EXCHANGE_NAME) Exchange exchange){
//        return BindingBuilder.bind(queue).to(exchange).with(RabbitMqConstants.FDL_ROUTING_KEY).noargs();
//    }
//
//    //FDL_INFORM_QUEUE队列绑定交换机，指定routingKey
//    @Bean
//    public Binding BINDING_DEVICE_REGISTER(@Qualifier(RabbitMqConstants.DEVICE_REGISTER_INFORM_QUEUE) Queue queue,
//                                           @Qualifier(RabbitMqConstants.QUEUE_EXCHANGE_NAME) Exchange exchange){
//        return BindingBuilder.bind(queue).to(exchange).with(RabbitMqConstants.DEVICE_REGISTER_ROUTING_KEY).noargs();
//    }

}
